package unit_6;
import java.util.Scanner;
public class Demo05 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个十进制数：");
        int n = sc.nextInt();
        int temp = n;
        String str = "";
        while(n != 0){
            str = n % 2 + str;
            n /= 2;
        }
        System.out.println(temp + "转换成二进制数为：" + str);

    }
}
